home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Compute! Gazette 1992 April
/
1992-04.d64
/
the cube
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-09-20
|
4KB
|
126 lines
0 clr
10 rem copyright 1992 - compute publications intl ltd - all rights reserved
60 print"[147]":poke53281,1:poke53280,1
70 r=0:print" the cube "
80 a=1138:b=55410:fork=1to4:readg:fort=1to4:poke a,160:pokeb,g:a=a+1:b=b+1
90 nextt:a=a+36:b=b+36:nextk:poke1141,32
100 dim a1(16):b1=1:tr=0
210 r=r+1:k=int(rnd(0)*16+1):if a1(k)=0then t=t: readl:a1(k)=l:goto230
220 r=r-1:goto210
230 if r<>16then210
235 a=1105:c=55377:z=1
240 form=z toz+3 :b=a:d=c
250 fork=1 to4:fort=1 to6:poked,a1(m):pokeb,160:b=b+1:d=d+1
260 next t:b=b+34:d=d+34:next k:a=a+7 :c=c+ 7:next m:a=b+19:c=d+19
270 ifb>1690thenprint"[145][145][145]":goto300
280 z=z+4:goto240
300 v=53248:poke2040,13:fors=832to832+62:readg:pokes,g:next
310 pokev+21,1:pokev+39,15:pokev,32:pokev+1,60 :pokev+23,1:pokev+29,1:x=32:y=60
320 get a$:if a$="[145]"and y>=100then y=y-40:pokev+1,y:b1=b1-4: goto320
330 if a$=""and y<=140then y=y+40:pokev+1,y:b1=b1+4: goto320
340 if a$=""and x<=144then x=x+56:pokev ,x:b1=b1+1: goto320
350 if a$="[157]"and x>=88 then x=x-56:pokev ,x:b1=b1-1:goto320
360 if a$="[133]" then 400
370 if a$="[136]" then 760
380 goto320
400 forg=1to16:if a1(g)=1then 420
410 next
420 on g goto 430,440,450,460,470,480,490,500,510,520,530,540,550,560,570,580
430 if b1=2 or b1=5 then600
435 goto320
440 if b1=1 or b1=3 or b1=6 then600
445 goto320
450 if b1=2 or b1=4 or b1=7 then600
455 goto320
460 if b1=3 orb1=8 then600
465 goto320
470 if b1=1 orb1=6 orb1=9 then610
475 goto320
480 if b1=5 orb1=2 orb1=7orb1=10then610
485 goto320
490 if b1=6 orb1=3 orb1=8orb1=11then610
495 goto320
500 if b1=7orb1=4 orb1=12then610
505 goto320
510 if b1=5 orb1=10orb1=13then620
515 goto320
520 if b1=9 orb1=6orb1=11orb1=14then620
525 goto320
530 if b1=10orb1=7orb1=12orb1=15then620
535 goto320
540 if b1=11orb1=8 orb1=16then620
545 goto320
550 if b1=9 orb1=14then630
555 goto320
560 if b1=13orb1=10orb1=15then630
565 goto320
570 if b1=14orb1=11orb1=16then630
575 goto320
580 if b1=15orb1=12then630
585 goto320
600 if g=1 then b=1105:d=55377:goto 640
601 if g=2 then b=1112:d=55384:goto 640
602 if g=3 then b=1119:d=55391:goto 640
603 if g=4 then b=1126:d=55398:goto 640
610 if g=5 then b=1305:d=55577:goto 640
611 if g=6 then b=1312:d=55584:goto 640
612 if g=7 then b=1319:d=55591:goto 640
613 if g=8 then b=1326:d=55598:goto 640
620 if g=9 then b=1505:d=55777:goto 640
621 if g=10then b=1512:d=55784:goto 640
622 if g=11then b=1519:d=55791:goto 640
623 if g=12then b=1526:d=55798:goto 640
630 if g=13then b=1705:d=55977:goto 640
631 if g=14then b=1712:d=55984:goto 640
632 if g=15then b=1719:d=55991:goto 640
633 if g=16then b=1726:d=55998:goto 640
635 goto 320
640 j=0:tr=tr+1
650 j=j+1:fort=1 to6:poked,a1(b1):pokeb,160:b=b+1:d=d+1:nextt
660 b=b+34:d=d+34:if j>3then 670
661 goto650
670 ifb1=1 then b=1105:d=55377:goto 710
671 ifb1=2 then b=1112:d=55384:goto 710
672 ifb1=3 then b=1119:d=55391:goto 710
673 ifb1=4 then b=1126:d=55398:goto 710
680 ifb1=5 then b=1305:d=55577:goto 710
681 ifb1=6 then b=1312:d=55584:goto 710
682 ifb1=7 then b=1319:d=55591:goto 710
683 ifb1=8 then b=1326:d=55598:goto 710
690 ifb1=9 then b=1505:d=55777:goto 710
691 ifb1=10then b=1512:d=55784:goto 710
692 ifb1=11then b=1519:d=55791:goto 710
693 ifb1=12then b=1526:d=55798:goto 710
700 ifb1=13then b=1705:d=55977:goto 710
701 ifb1=14then b=1712:d=55984:goto 710
702 ifb1=15then b=1719:d=55991:goto 710
703 ifb1=16then b=1726:d=55998:goto 710
705 goto 320
710 j=0
720 j=j+1:fort=1 to6:poked,a1(g ):pokeb,160:b=b+1:d=d+1:nextt
730 b=b+34:d=d+34:if j>3then 750
740 goto720
750 a1(0)=a1(b1):a1(b1)=a1(g):a1(g)=a1(0):g=b1:goto320
760 r=0:if a1(1)=0 and a1(2)=0 and a1(3)=0 then r=r+1
770 if a1(5)=2 and a1(6)=2 and a1(7)=2 and a1(8)=2 then r=r+1
780 if a1(9)=6 and a1(10)=6 and a1(11)=6 and a1(12)=6 then r=r+1
790 if a1(13)=5 and a1(14)=5 and a1(15)=5 and a1(16)= 5 then r=r+1
800 if r=4 then print"congratulations it only took you";
810 if r=4 then print tr;"times to solve the puzzle":end
820 print" keep trying":fort=1 to 30
830 poke209,0:poke210,212:poke211,0:print"0d h[213][190] [184][146]@@@@@@@_u@[192]@@@@@o";
840 n=54296:next:poken,0:print" ":goto320
850 rem *****************
860 rem "" = right movement
870 rem "[157]" = left movement
880 rem "[145]" = upward movement
890 rem "" = downward movement
900 rem "[133]" = switches the blocks
910 rem "[136]" = checks to see if puzzle is solved
920 rem program written by michael pope
930 rem *****************
1000 data 0,2,6,5,0,0,0,1,2,2,2,2,6,6,6,6,5,5,5,5,0,0,0,255,255,255
1010 data 255,255,255,192,0,3,192,0,3,192,0,3,192,0,3,192,0,3,192,0,3,192,0,3
1020 data 192,0,3,192,0,3,192,0,3,192,0,3,192,0,3,192,0,3,192,0,3,192,0,3
1030 data 192,0,3,255,255,255,255,255,255